package com.bs.elasticsearch.service;

import com.bs.common.utils.PageUtil;
import com.bs.elasticsearch.vo.*;
import com.bs.elasticsearch.vo.param.NearByPoiParam;
import com.bs.elasticsearch.vo.param.SearchNamePoiParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @author bingshao
 * @date 2023/4/7
 **/
public interface ReadCsvToElasticService {

    /**
     * 创建索引
     */
    void createIndex();

    /**
     * 读取csv文件存入ES
     *
     * @param file
     * @param addressIdVo
     */
    void readCsv(MultipartFile file, AddressIdVo addressIdVo) throws IOException;


    /**
     * 固定位置查询范围内的其他店
     *
     * @param id
     * @return
     */
    PageUtil<List<LocationVo>> geoSearch(Long id);

    /**
     * 根据经纬度查询行政区域
     *
     * @param lat
     * @param lon
     * @return
     */
    GeoLocationAreaVo geoByLonAndLat(Double lon, Double lat) throws IOException;

    /**
     * 读取csv文件存入ES
     *
     * @param file
     */
    void readPoiCsv(MultipartFile file) throws Exception;

    /**
     * 根据经纬度搜索附近POI点
     *
     * @param nearByPoiParam
     * @return
     */
    List<GeoLocationPoiVo> getNearByPoi(NearByPoiParam nearByPoiParam);

    /**
     * 根据名称搜索POI点
     *
     * @param searchNamePoiParam
     * @return
     */
    List<GeoLocationPoiVo> searchNamePoi(SearchNamePoiParam searchNamePoiParam);

    /**
     * 根据地区码获取经纬度等信息
     *
     * @param areaCodeList
     * @return
     */
    List<GeoLocationVo> getByAreaCode(List<String> areaCodeList);

}
